package com.autism.day02.redpackage;

import java.util.ArrayList;
import java.util.Random;

public class Member extends User {
    public Member() {
    }

    public Member(double amount, String name) {
        super(amount, name);
    }

    public void receive(ArrayList<Double> list) {
        //从多个红包中随机抽取一个
        int index = new Random().nextInt(list.size());
        double delta = list.remove(index);
        double money = super.getAmount();
        super.setAmount(delta + money);
    }
}
